<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" src="js/boot.js"></script>
		<title></title>
	</head>

	<body>
	</body>

	<script type="text/javascript">
		var openId = common.getRequestParams("openId");
		if(openId) {} else {
			openId = "os7_p0fLeHv3d7A_OXn5LEpKf4H0";
			alert("微信用户openId获取失败，请退出重试!（目前测试ID为：os7_p0fLeHv3d7A_OXn5LEpKf4H0）");
		}
		// debugger
		var id = common.getRequestParams("id");
		localStorage.setItem('_token', common.getRequestParams("_token"));
		localStorage.setItem('openId', openId);
		var url = "/user/loginByOpenId.do?openId=" + openId;
		http.get(url, function(data) {
			debugger
			if(data.success) {
				localStorage.setItem('_token', data.dataMap._token);
				var user = data.data;
				user.token = data.dataMap.token;
				localStorage.setItem('user', JSON.stringify(user));
				if(id == 1) {
					url = "/weixin/1-binding.html";
				} else if(id == 2) {
					url = "/weixin/2-0-tools.html";
				} else if(id == 3) {
					// url = "/weixin/account.html";
					// url = "/weixin/pay/order.html";
					url = "/weixin/3-0-my.html";
				}
				http.gotoHtml(url);
			} else {
				alert(data.message);
			}
		});
	</script>

</html>